<html>
    <head>
        <title>Test</title>
        <style>

        </style>
        <script type="text/tiscript">

          event change $(button#show) {
            const toShow = this.value; // bool , value of button#show checkbox
            const pwd = $(#password);
            var val = pwd.value; 
            pwd.attributes["type"] = toShow ? "text" : "password";
            pwd.value = val;
          }

        </script>
    </head>
    <body>

      <input|password #password> <button|checkbox #show>Show</button>

    </body>
</html>